#pragma once

using namespace std;



#include "Effect.h"

#include <vector>
#include <string>
#include "boost/smart_ptr.hpp"
#include "Poco/DOM/Document.h"

using Poco::XML::Node;
using boost::shared_ptr;

/* Job class
 * new-job xml parser class
 * based on Poco:XML 
 */
class Job {
public:
    /* Job c'tor
     * get the resourceId and the raw xml string, and parse it
     * throws exception on invalid xml
     */
	Job(int resourceId, const string& xml);
    /* getter for the ResourceId  */  
    int getResourceId();
    /* getter for the InputRepresentation */  
	int getInputRepresentation();
    /* getter for the OutputRepresentation */  
    int getOutputRepresentation();
    /* getter for the EffectList */  
    vector< shared_ptr <Effect> > getEffects();
private:
    int resourceId;
	int inputRepresentation;
    int outputRepresentation;
	vector< shared_ptr <Effect> > effects;
    /* helper functions to get a specific node by name */  
    Node* getNodeByName(Node* pNode, const string& name);
    /* helper functions to get a specific attribute by name */  
    string getAttributeValue(Node* pNode, string attributeName);
    /* helper functions to get a specific node value by name */  
    string getNodeValueByName(Node* pNode, const string& name);
};

